US President Donald Trump has said that the war with Iran was close to ending, as a renewed diplomatic push raised the possibility of further talks in Pakistan between officials from both sides.