The United States and Iran have signed a preliminary agreement aimed at ending months of conflict and paving the way for the reopening of the Strait of Hormuz, sanctions relief for Tehran and a new round of negotiations on Iran's nuclear programme.