The shah of Iran, fighting to retain control over his rich oil nation, postponed a trip to Romania and East Germany yesterday to deal with increasingly violent protests against his rule.

The capital's new martial-law administration deployed tanks at key points, including the parliament building and Jaleh Square, where army troops killed at least 86 demonstrators Friday, according to an official count.

The minister of the shah's Imperial Court, Amir Abbas Hoveyda, meanwhile announced his resignation amid indications the government is trying to appease Moslem religious leaders who have spearheaded nine months of swelling opposition to the shah's modernization efforts.

Hoveyda, 59, who was replaced as prime minister last year after 12 years in the post, is considered unpopular with the conservative Moslem mullahs, whose ancestral hold on traditional Iranian society has been challenged by the shah's oil-financed development plans.

The death toll reflected a coroner's office count of death certificates issued so far for Friday's victims. The actual count is widely believed to be far higher, possibly more than 200. Some opposition sources claim several hundred people were killed and many more wounded in the shooting, which touched off a rampage in which several buildings went up in flames.

Tehran's second day of martial law was calmer than the first, but witnesses reported several shooting incidents in the southern and eastern parts of the capital as army troops in battle dress tried to disperse gatherings of angry residents.

Opposition sources said troops fired into crowds for the second straight day, but no details could be confirmed. Witnesses said soldiers fired bursts from their M16 automatic rifles into the air near the labyrinthine Tehran bazaar, which remained shut in a protest strike.

Under the new martial law regulations for Tehran and 11 provincial cities, authorities began a crackdown on dissent, effectively calling to a halt to the political liberalization program of Shah Mohammed Reza Pahlavi. Opposition sources said the homes and offices of several leading dissidents were raided and their papers confiscated. A dissident lawyer, Hedayatollah Matin-Daftari, was detained for several hours Friday and another longtime political opponent of the government, Mehdi Bazargan, was arrested last night, sources said.

In addition, a number of Iranian journalists and religious and political opposition figures are reported to have gone underground, fearing arrest.

Press censorship has been effectively reimposed after two weeks of relative freedom since the new government of Prime Minister Jaafar Sharif-Emami took office following an earlier phase of the disturbances.

"It's back to the old days," said one disquruntle editor.

Two of Iran's top resident religious leaders strongly condemned Friday's shootings, but they appealed to the followers to remain calm and avoid giving authorities a pretext to fire on them.

In an apparent reference to the new martial law administration, Ayatollah Shariatmadari said in a statement from his residence in the holy city of Qom, which is also under martial law, that Iranians should not give "the tools of imperialism and dictatorship" any reason to take advantage of the present situation "for their own ends."

In separate statements, he and another Shiite Moslem leader, Ayatollah Shirazi, quoted a verse from the Koran warning ambigously, "The oppressors will soon come to know their fate." Some demonstrators have said they are only awaiting an order from the religious leaders to take to the streets again.

The shah had been scheduled to visit Romania and East Germany starting Monday. A palace spokesman said he postponed the trip indefinitely "due to present circumstances."

The army remained in firm control of Tehran after a 9:00 p.m. to 5:00 a.m. curfew. Truckloads of troops, tanks and armored personnel carriers mainly in the southern and eastern parts of the capital, where numerous slogans scrawled on walls proclaimed widespread opposition to the shah's rule.

"People get armed," said one. "Death to the shah, the murderer," said another.

News agencies reported from Tehran :

Tehran hospitals posted signs asking for blood donations.

There were no reports of injuries to the 120,000 foreigners, including 40,000 Americans, who live in Iran. Many of the Americans are connected with the military or the oil industry that has transformed Iran in recent years.

Numerous antigovernment groups including a terror group the government calls "Islamic Marxists" have joined the religious leaders in demanding a return to strict observance of Islamic law.The government blames the Islamic Marxists for starting a theater fire in Abadan, in south-western Iran, that killed at least 377 people last month.

The mullahs, or prayer leaders of the Shiite sect that embraces 90 percent of the population see the shah's social reforms as contrary to the teachings of the Moslem holy book, the Koran.

The reforms removed huge tracts of farmland from control of the clergy and leased it to small farmers. They also gave women the vote, permitted them to attend universities and let them discard their veils.

It was an attempt to appease his religious and political opponents that the shah named Sharif-Emami, a devout Moslem, as prime minister on Aug. 27. Sharif-Emami closed all the casinos and announced that all legal parties could take part in the government.

In Washington, the State Department said it believes the government remains in control. Department spokesman Charles Shapiro said: "Regarding the threat to the shah and his government, while we do not belittle the gravity of the events, we believe that the Iranian government remains in control of the situation."

The United States sees the situation as essentially an internal affair, he added.

The spokesman said: "We said Friday that we hope order will soon be restored in Tehran and we repeat our hope that calm will be returned to the situation. We also repeat our deep regret over the loss of life and injuries."