The US president has lashed out at European partners for declining to contribute military forces to the war on Iran.