By John Irish and Arshad Mohammed

VIENNA (Reuters) - Iran and major powers gave themselves at least until Friday to negotiate an agreement on the Iranian nuclear programme, but a source from one of the powers said on Tuesday they had to wrap up in the next 48 hours.

"We are continuing to negotiate for the next couple of days," EU foreign policy chief Federica Mogherini said outside the hotel where the marathon talks between Iran, Britain, China, France, Germany, Russia and the United States are taking place.

The spokeswoman for the U.S. delegation, Marie Harf, said the terms of an interim deal between Iran and the six would be extended through Friday to give negotiators a few more days to finish their work.

The negotiators had set Tuesday as a deadline when it became clear last week that a June 30 deadline would not be met. But despite a push in the past few days they made clear again that they still needed more time.

"We're frankly more concerned about the quality of the deal than we are about the clock, though we also know that difficult decisions won't get any easier with time," Harf said.

There was disagreement about whether the talks were in effect open-ended. U.S. officials hoped to wrap them up in time for a 4 a.m. GMT Friday (midnight EDT Thursday) deadline to secure an expedited review by the U.S. Congress, but it was unclear if that was possible.

"No deadline is sacrosanct for us," senior Iranian negotiator Abbas Araqchi told reporters. "We are ready to stay in Vienna and continue talks as long as it is necessary."

Western diplomats said they had not yet given up hope of making the deadline for the U.S. congressional review.

The source from one power, however, said there would be a time limit.

"We've come to the end," said the source, on condition of anonymity. "We have just made one, final extension. It is hard to see how or why we would go beyond this. Either it happens in the next 48 hours, or not."

'HEATED EXCHANGE'

Diplomats said a discussion on Monday night between Iran and the major powers became testy over the issue of U.N. sanctions, which Iran wants scrapped as part of a deal to curb its nuclear programme.

"There was no slamming of doors but it was a very heated exchange of views," a senior Western diplomat told reporters.

The comprehensive deal under discussion is aimed at curbing Tehran's most sensitive nuclear work for a decade or more, in exchange for relief from economic sanctions that have slashed Iran's oil exports and crippled its economy.

The United States and its allies fear Iran is using its civilian nuclear programme as a cover to develop a nuclear weapons capability. Iran says its programme is peaceful.

An agreement would be the most important milestone in decades towards easing hostility between the United States and Iran, enemies since Iranian revolutionaries captured 52 hostages in the U.S. embassy in Tehran in 1979.

It would be an important achievement for U.S. President Barack Obama and Iran's pragmatist president, Hassan Rouhani, but both leaders face scepticism from hardliners at home.

It is the fourth time the parties have extended the interim deal struck in November 2013 that gave Iran limited sanctions relief in return for its restricting its nuclear programme, including halting production of 20 percent enriched uranium.

The latest extension to Friday left open the possibility an agreement would not arrive in time for the deadline to allow an expedited, 30-day review of a deal by the U.S. Congress.

If a deal is sent to Congress between July 10 and Sept. 7, Congress will have up to 60 days to review it. U.S. officials fear that could provide more time for any deal to unravel or for pressure groups to influence U.S. lawmakers to oppose any pact.

In Washington, several members of Congress said they did not want negotiators to rush. "I again urge negotiators to hold firm, take their time and be prepared to step back from the table," said Republican U.S. Senator Bob Corker, author of the law requiring the congressional review.

Among the sticking points, officials said, are Iranian demands for a U.N. arms embargo and ballistic missiles sanctions to be lifted, the timing of U.S. and EU sanctions relief, and future Iranian nuclear research and development.

A senior U.S. official said U.N. restrictions would remain on Iran's trade in arms and its access to missile technology, but left open the possibility that these might be less onerous than they are at present.

Story continues