Talks in Vienna stalled last Friday, denting hopes that negotiators could meet a July 20 target. The failure to advance diminished optimism that had been growing since negotiations began Feb. 18 on a comprehensive deal.
The talks involve Iran and the five permanent members of the U.N. Security Council plus Germany.
"It is very likely that we can come to an agreement by the end of July," President Hassan Rouhani told a news conference. He was in Shanghai for an Asian security conference.
Reaching agreement depends on unspecified countries not being given a chance to "create problems," Rouhani said.
Western nations say Iran's nuclear program could allow it to build atomic weapons. Iran says its program is for peaceful purposes such as medical research and power generation.
Because the technology can also create weapons-grade uranium for warheads depending on the level of enrichment, Washington and its allies want strict constraints on its size and scope.
Deputy Iranian Foreign Minister Abbas Araghchi said last week in Vienna that differences remain on more than a dozen issues. A Western official with detailed knowledge of the talks said enrichment was among the most divisive topics.
Rouhani also held out the possibility the deadline might be extended by six months.
"We're not in a hurry to reach an agreement but if there is goodwill in the 5+1 countries and enough efforts, in my view there is enough time for conclusion," he told reporters.
The Iranian leader criticized Western sanctions imposed over the nuclear program.
"People are happier in Iran than they were a year ago, happier economically and socially," he said.