TEHRAN -- Iran, in an apparent attempt to counter U.S. efforts to impose an arms embargo against it, has moved to expand its diplomatic contacts in East and West and appears to have mounted a major campaign to get the Soviet Union to break its links with Iraq.

At the same time, Iran has strenuously renewed its demands that Iraq be declared the aggressor in their war before any cease-fire in the seven-year-old conflict is possible, according to officials and diplomats in the Iranian capital. The renewed hard-line has been seen as a setback to apparent gains of U.N. Secretary General Javier Perez de Cuellar's recent mission to the region.

Diplomats here have recently noted some of the warmest comments toward the Soviets since the Iranian revolution, while Moscow has resumed flights to Iran by the state airline, Aeroflot, and begun visits here by top-level officials. Foreign Minister Ali Akbar Velayati began a visit this week to two of Moscow's closest allies outside the East Bloc, Cuba and Nicaragua.

Iran also is trying to revive diplomatic ties with Britain and France -- badly strained after a series of diplomatic incidents earlier this year. "We are in constant touch with London and Paris and hope the situation will improve soon," Deputy Foreign Minister Mohammed Jawad Larajani said in an interview last week.

Diplomats have noticed an unusual number of contacts in recent days between the Iranian government and the large Soviet Embassy here. They noted in particular the friendly comments directed at Moscow at Friday prayer services in Tehran last week, in which Supreme Court justice Mousavi Ardebelli, who is said to be close to Ayatollah Ruhollah Khomeini, praised the Soviet role in the Persian Gulf.

"Moscow has definitely played well with us," Ardebelli said. Slogans calling for "death" for the Soviet Union and the United States, a staple at Friday prayers, suddenly have dropped references to the Soviets. Khomeini had previously referred to Washington and Moscow as the "great Satan."

Only 48 hours after Ardebelli's speech, Moscow announced the resumption of Aeroflot flights, halted during intensive Iraqi air raids on Tehran during 1985, and the Iranian oil minister left for Moscow to discuss new oil pipeline links between the two countries.

While Ardebelli's comments were widely reported in the Iranian media, they were omitted in Tehran's English-language papers. Subsequent Soviet-related items, such as the resumption of Aeroflot flights, have received low-key treatment, reflecting the caution with which Iran is approaching ties with Moscow.

Iranian officials are "measuring the public response to the overtures toward Moscow," said an Asian diplomat. Iran's goal in these maneuvers is to provide diplomatic leverage with the West, break its isolation and try to put a wedge between Moscow and Iraq. The Soviets have been Baghdad's main arms supplier for years.

"Iran is seeking material relations and not ideological {ones}," said one Iranian official of the contacts with Moscow. "Of course, we believe their system is not much good, but it does not bother us much."

While Soviet officials appear eager to develop closer links with Iran, they are said to be cautious about breaking ties with Baghdad.

"They have told us that they have 30 years of investment in Iraq, but they are ready to alter the position gradually," said one Iranian official.

A key signal to the progress of relations between the two will be a proposed visit to Moscow of Iran's powerful parliamentary speaker, Hojatoleslam Ali Akbar Hashemi Rafsanjani. The Iranians have agreed to a visit in principle but are believed to be holding back on setting a date, in hopes of gaining more concessions from the Soviets.

British relations with Tehran were set back last May when armed men in Tehran abducted an envoy assigned to Britain's interests section in Tehran. Britain closed its embassy in September 1980.

France closed its embassy last July after crowds besieged it in retaliation for French attempts to arrest an employe at Iran's Paris embassy who was suspected of involvement in terrorism. Iran later tried to arrest a French diplomat in Tehran, alleging he was involved in espionage.

Iran apparently is trying to find a formula for ending disputes over diplomatic privileges that have sent relations to a new low. The Iranians are said to have suggested a variety of formulas to Paris for simultaneous trials of the employes being sought at their respective embassies. So far, Iran has been rebuffed by Paris, which considers Iranian charges against its personnel unjustified.

The revival of hard-line rhetoric demanding that Iraq be declared the aggressor in the Persian Gulf war has made the possibility of success for Perez de Cuellar's proposed second mission even more dubious, according to analysts here.

Iranian President Ali Khamenei reportedly told a group of Revolutionary Guards in his office last week, "There will be no cease-fire from our side until Iraq is declared an aggressor and an international committee is found to determine punishment" for the government of Iraqi leader Saddam Hussein.

This theme was echoed by a number of Iranian officials last week, despite reported Iranian suggestions during Perez de Cuellar's first mission that Tehran would consider an "informal" cease-fire while an international body determined fault for the start of the Persian Gulf conflict.