Four of Japan's large trading companies signed long-term contracts for Iranian oil today, easing the severe threat caused by Iran's cutoff to this nation that imports nearly all its crude.

The contracts, amounting to about 500,000 barrels a day, mark the first known agreements of their kind with Iran since the new Islamic-inspired government in Tehran took control of oil production and renounced previous marketing contracts. Industry sources said others, including the Italian national oil company, ENI, also have been bargaining for a similar deal.

With the new contracts, accompanied by energy-conservation measures, Japanese officials are said to feel the petroleum pinch here is now manageable.

The conservation plan announced today is designed to reduce oil consumption by 5 percent this year. It calls for less heating and air conditioning in government offices, but relies primarily on voluntary cuts in oil use and is less severe than controls employed during the 1973 oil shock that plunged Japan into a recession.

A high official of the Ministry of International Trade and Industry said today that the Iranian disruption could still have "a very serious effect" on Japan by next winter.

"But it depends on how we handle it," said Kazuo Kamiya. "We think we can mange it. It could have a very serious effect, but it is not meaningful to refer to it as a crisis."

The iranian cut of initially had spread a sense of alarm through Japan. Between 17 and 20 percent of this country's daily consmption f 5.5 million barrels a day came from Iran before the revolution there. With almost no resources of its own, Japan stepped up its search for other foreign sources, renewing interest in Alaskan oil and opening negotiations with Mexico.

It also quickly got in line for a renewal of Iranian oil supplies when production resumed there, and the disclosure today of four big long-term contracts brought sighs or relief from government officials.

The four companies -- Mitsui, Mitsubishi, C. Itoh and Marubeni -- were said to have signed agreements to import a total of 500,000 to 600,000 barrels a day under a contract with the National Iranian Oil Co. The oil would become available next month.

Only Mitsui of the four giant trading companies specifically acknowledged the contract publicly, but government soures said the other three also had signed.

Mitsui declined to reveal the price paid for the oil and sources said it probably will be set at the rate to be fixed by the major oil-exporting countries at a meeting March 26. Iran has been getting between $18 and $20 a barrel on the spot market recently as its national oil company seeks to make sales directly rather than through the 14-company Western consortium that sold most Iranian production under the deposed shah.

The trading companies deal came only one day after Japanese oil suppliers had been startled to learn that Exxon plans to cut off oil to many of its customers here by next year. Exxon officals disclosed that, as an indirect result of the Iranian disruption, their company would cut by about 50 percent this year the amount of oil sold to Japanese companies not affiliated with Exxon. Beginning next year, Exxon said, it would sell no more oil at all to such customers.

Exxon in 1977 sold Japan about 14 percent of this country's total oil imports and about a third of that had gone to nonaffiliated companies that will now be cut off.

Shortly afterward, the Shell company in Japan, Shell Sekiyu, announced it also is curtailing sales to unaffiliated companies by between 15 and 20 percent, beginning next month.

That bad news was in large part offset by the new Iranian contracts revealed today. Most oil industry experts here now believe Japan will survive the curtailments fairly well until at least next winter. One reliable industry source estimated the net effect will mean that Japan will get by with only about 2 percent less oil this year than last.

"But next year -- who knows?" he added.

The energy-conservation plan is in line with decisions reached by Japan and 19 other countries in the Parisbased International Energy Agency. which recently called on all members to reduce consumption by 5 percent this year.

The only compulsory part of the plan calls for reduction in heating temperatures in government offices and less air conditioning this summer. It also urges families to reduce temperature levels at home, to use their television set less and to turn off lights when they are not in use.