Pledge brings defence budget in line with treaty obligation earlier than planned after criticism by Donald Trump