Shah Mohammad Reza Pahlavi returned to a quiet capital tonight after a day's rest in a hunting lodge nearby as the atmosphere of crisis in Iran eased somewhat and the challenge to his rule appeared less immediate.

The country was generally free of violence and some workers in strikebound industries were trickling back to their jobs. Oil workers were expected to get production up to a million barrels a day on Saturday, a level sufficient for domestic needs.

The respite may well be only temporary, however. Iran's new civilian government is to be formed over the weekend and some shops and industries as well as the newspapers are scheduled to reopen. These two days will provide a crucial test of whether the shah's last-ditch formula for survival has a chance of working.

That formula calls for the new prime minister, Shahpour Bakhtiar, to install a Cabinet of men who have not held any ministerial position for 25 years, are not tainted by corruption and are acceptable to opponents of the shah, while the shah continues as monarch with reduced powers. The shah's most determined opponents want him ousted altogether.

Although Bakhtiar has not yet published his Cabinet list and is apparently still negotiating over some portfolios, reports circulating here indicate that a number of respected opposition figures with good religious and political credentials are prepared to participate.

The most uncompromising of the shah's foes, led by the exiled religious leader Ayatollah Ruhollah Khomeini, have refused to endorse any formula that perpetuates the monarchy, however watered down its power. Nevertheless, the ayatollahs have not specifically condemned the Bakhtiar government nor called for mass opposition to it.

That is apparently because they are waiting to see if Bakhtiar makes good on what they believe is his commitment to get the shah out of the country, a commitment on which he has already waffled, if he ever made it.

Khomeini told an interviewer in Paris today that "there is no place in Iran's future for the shah, whose hands are stained with the blood of the people."

Iran's main political opposition grouping, the National Front, aligned with the religious leaders in the desire to oust the shah, backed down today on its call for new strikes and demonstrations on Sunday, apparently yielding to the "wait and see" attitude of the Moslem clergy toward the Bakhtiar government.

On paper, Bakhtiar already has promised to give the opposition most of what it wants -- an end to oppression and corruption, freedom of the press and of political parties, and a new independent line in foreign policy. But the crucial issue, that of the shah's role, remains unresolved.

It will have to be settled soon if the country is to resume functioning normally.

Workers in the oil industry have already begun to go back to work and to increase Iran's production to meet domestic needs. But they have done so, according to sources in a delegation that has been negotiating with them, only on condition that there be no oil exports so long as the shah is in power.

Since oil exports are the backbone of the Iran economy and Bakhtiar has said he wants to resume them, that impasse threatens the entire formula. Iran is losing about $70 million a day in revenues as a result of the stoppage of oil exports.

Production of a million barrels a day would be only about one-sixth of Iran's normal, but it is four times the average level of the past week and would put an end to the shortages of gasoline, heating oil and kerosene that have crippled the country.

Members of the opposition delegation that has been negotiating with the workers to persuade them to produce enough oil for domestic needs said they toured the crude oil export terninal on Kharg Island today. Reached by telephone at Alwaz in the south, they said they are to certify to the workers that no oil is being exported, after which the workers have agreed to go back to their jobs.

Some gasoline has already begun flowing from the Abadan refinery to Tehran, oil sources said, but long lines are still forming at gasoline stations here and all around Iran.

The burden of the fuel strike has been eased by unusually balmy midwinter weather. Temperatures in Tehran soared into the sixties today, and the parks were full of tennis players and children on swings.

Army and air force units continue to patrol downtown streets but there were no reports of clashes. Friday, the Moslem day of prayer, is the weekly holiday and most businesses would have been closed whether there was a general strike or not. Grocery and sandwich shops remained open and those who had enough gasoline found the ski lifts still operating in the Alborz Mountains overlooking the city.

Even a few movie houses which are opposed by Moslem fundamentalists, were open in central Tehran. Most have been boarded up since demonstrators made them a favorite target during the past year of violence. A few policemen returned to the streets.

The cumulative impression was of a country that has been locked for months in a struggle over its own future and may be prepared to live at peace for awhile with the new government.

The question facing Iran is whether the desire to restore normal life will override the determination of the opposition to abolish the country's political system altogether.