Donald Trump further said, "You can't stop people from talking." (AFP photo)

US President Donald Trump on Sunday denied signing off on a joint G7 message to Iran over its nuclear programme as announced by his French counterpart Emmanuel Macron.

"No I haven't discussed that," Trump told reporters on the sidelines of the G7 summit in the southwestern French resort of Biarritz.

This contradicted Macron who shortly beforehand had said the G7 countries "agreed on what to say to Iran".

Trump said: "We'll do our own outreach. But you can't stop people from talking. If they want to talk, they can talk."

A landmark 2015 nuclear deal between Western powers and Iran all but collapsed after Trump unilaterally withdrew US support last year, reimposing sanctions that have crippled Iran's economy.

Macron has been leading efforts to defuse the crisis by finding ways of resuming dialogue, meeting Iran's top diplomat Mohammad Javad Zarif for rare talks in Paris on Friday on the eve of the summit.

He has also held telephone talks with President Hassan Rouhani

On Sunday, a diplomatic source said G7 leaders had mutually agreed to task Macron with sending a message to Iran.

"Emmanuel Macron was mandated to talk with Iran and address a message" to the country to avoid an escalation in the region, said the source.