Hassan Rouhani and Mr Cameron discussed Iran's nuclear programme, a Downing Street spokesman said. The two men "agreed to continue efforts to improve the relationship" between the UK and Iran, he added.
On Monday, President Rouhani warned world leaders seeking to curb his country's nuclear ambitions not to make "excessive demands".
Representatives from Iran and the P5+1 group of nations will begin a new round of negotiations in Geneva on Wednesday, media reported.
Three days of high-level talks earlier this month failed to achieve a breakthrough.
Iran says its uranium-enrichment is for energy-creation purposes, rather than weapons.
The UK shut its Tehran embassy in 2011 after it was stormed in a protest over sanctions imposed because of its nuclear programme.
As efforts to improve relations continue, the UK's new charge d'affaires for Iran, Ajay Sharma, was named by the Foreign Office last week. He is expected to visit the country later this month.
Iran has appointed Mohammad Hassan Habibollah as its charge d'affaires for the UK.