US President Donald Trump has said the country's navy will protect ships in the Middle East "if necessary" in a bid to stop the energy supply crunch sparked by the war with Iran.