Prime Minister Sir Keir Starmer spoke to Iranian president Masoud Pezeshkian on Monday evening, urging him to "refrain from attacking Israel", Downing Street said.
It comes amid fears retaliation for the recent killings of senior members of militant groups Hezbollah and Hamas may lead to a wider war in the region.
A Number 10 spokeswoman said: "The Prime Minister said that he was deeply concerned by the situation in the region and called on all parties to de-escalate and avoid further regional confrontation.
"There was a serious risk of miscalculation and now was the time for calm and careful consideration, the Prime Minister said. He called on Iran to refrain from attacking Israel, adding that war was not in anyone's interests.
"The Prime Minister underlined his commitment to an immediate ceasefire, the release of all hostages and increasing humanitarian aid to Gaza. He added the focus should be on diplomatic negotiations, to achieve those outcomes.
"The Prime Minister also raised the cases of foreign detainees in Iran, adding that it was vital that they received the necessary medical care.
"The leaders agreed that a constructive dialogue between the UK and Iran was in both countries' interests. The Prime Minister added that could only be furthered if Iran ceased its destabilising actions including threats against individuals in the UK and did not further aid Russia's invasion of Ukraine."
The phone call followed a day of talks among western powers, with joint statements from British, American and European leaders urging de-escalation in the Middle East amid fears Iran could launch an attack on Israel this week.
Sir Keir, along with US President Joe Biden, German Chancellor Olaf Scholz, French President Emmanuel Macron and Italian Prime Minister Giorgia Meloni urged all parties to resume peace talks this week, saying there is “no further time to lose”.
Mr Biden also issued a statement along with Egyptian President Abdel Fattah El-Sisi and Qatari leader Amir Tamim bin Hamad bin Khalifa Al Thani endorsing a three-phase framework to demand Israel withdraws its troops from Gaza, Hamas returns hostages to their families, and the safe and effective distribution of humanitarian aid.
They urged “both sides” in the Gaza conflict to join talks in Cairo or Doha on August 15, adding: “As mediators, if necessary, we are prepared to present a final bridging proposal that resolves the remaining implementation issues in a manner that meets the expectations of all parties.”
On August 9, Israeli Prime Minister Benjamin Netanyahu said his country would send a negotiating team “to a place to be determined in order to finalise the details of the implementation of the framework agreement”.
Tel Aviv has warned it will retaliate against any attacks by Iran, with Israeli government spokesman David Mencer telling Sky News it would “exact a heavy price for any aggression against us from any arena”.