WASHINGTON (AP) _ President Reagan sought to avoid public friction with Israeli Prime Minister Yitzhak Shamir on the Iran arms scandal Wednesday, but an administration official said the president privately asked Shamir to cooperate in investigations of the affair.

Shamir later restated his government's position that Israel would cooperate but only in writing, meaning Israeli officials would not be made available for direct questioning.

Chairmen of the Senate and House committies investigating the Iran-Contra matter indicated that response was acceptable, and House Speaker Jim Wright declared, ''We will respect their sovereignty and they will respect our need for information.''

Reagan avoided questions from reporters on the sensitive subject of the weapons sales during a picture-taking session in the Oval Office and mentioned it only briefly later as Shamir departed after a two-hour meeting.

''I underscored our opposition to Iran's use of force, terrorism and expansionism,'' Reagan said, standing alongside Shamir outside the White House, both of them without overcoats in chilly temperatures. ''In discussing Iran and other regional issues, the prime minister and I agreed on the importance of looking to the future instead of dwelling on the past.''

However, a senior administration official, briefing reportrrs later on condition he remain anonymous, said Reagan urged Israeli cooperation in various investigations of the secret sale of arms to Iran and the diversion of profits to the Nicaraguan Contra rebels.

''I know that point was made,'' the official said. ''We urged that the Israeli government cooperate, and we have assisted Israeli authorities with getting in touch with the appropriate investigating bodies here and they said they would get in touch and they will cooperate.''

The U.S. official declined to say whether the arrangement of written testimony was satisfactory.

Late Wednesday, Shamir stressed cooperation between the two countries and ''Israel's status of a major non-Nato ally and friend.'' In a speech to a group of Jewish leaders from the United States and Canada, Shamir said that meant Israel and the United States would work even closer together in a variety of arenas.

''This means that there will be closer coordination between our armed forces and those of the United States and the European command of the U.S. forces,'' Shamir said. ''We will conduct joint maneuvers. We will help each other in sensitive maneuvers such as antiterrorism warfare. We will exchange information on ... threats to individual security. And we will cooperate in deterring possible threats of aggression.''

Israel's special status as a non-NATO ally stems from legislation Congress approved for the purpose of allowing Israel and other countries to participate with the United States in joint research and development in military areas.

''This means that we will be still closer, that we will act together in pursuit of our common objectives and ideals,'' Shamir said.

The Iran arms deal is sensitive for Reagan and Shamir. Even while condemning the fundamentalist Moslem government in Tehran as a supporter of terrorism, both the United States and Israel delivered weapons to Iran.

Reagan also displayed interest in a Middle East peace conference as a step toward settling Arab-Israeli differences, despite opposition voiced earlier by Shamir.

''Any reasonable means, including an international conference, should be considered,'' Reagan said. But he stressed the need for direct negotiations between Israel and its neighbors, including Palestinian Arabs.

''The United States remains ready to be an active partner in any serious peace effort,'' Reagan said.

Shamir called the pursuit of peace ''a noble goal,'' but he made no reference to a peace conference, which he condemned on Tuesday as a Soviet ''invention.''

Standing alongside Shamir, Reagan said ''our discussions went well.'' He said Shamir's visit ''symbolizes the close and special relations between our countries.''

Without directly mentioning the Iranian affair that has appeared to weaken Reagan's political strungth, Shamir praised the president effusively.

''Mr. President, America under your leadership stands tall and upright despite transient difficulties,'' Shamir said. ''You continue to discharge your great responsibility as the leader of the free world.''

In a session later with Israeli reporters, Shamir said Reagan had assured him he would not allow the Soviet Union and the Palestine Liberation Organization to disrupt the peace process.

Reagan and Shamir met first in the Oval Office and continued their conversations over lunch. Later, Shamir met for about two hours with congressional leaders.

He said he was not worried about damage to U.S.-Israeli relations from the Iran-Contra affair, declaring that ''this friendship is very deep, and it becomes deeper, more and more, from year to year.''

He said the agreement reached for answering questions of U.S. investigators on the Iran-Contra matter involved government-to-government exchanges betwuen the two countries.

''It is a question of people who represented the government of Israel in a joint operation, and therefore the government is responsible for their actions,'' Shamir told reporters.

Sen. Daniel Inouye, D-Hawaii, chairman of the Senate Iran-Contra investigating committee, said inquiries would be relayed to the Israelis through Secretary of State George Shultz rather than directly from the committees and that if clarifications are needed ''steps will be taken by both governments to bring this about.''

Rep. Lee Hamilton, D-Ind., chairman of the House committee, said, ''Our purpose is to get the facts. That's what we want.''

For the first time since Dec. 4, reporters were given a chance to question the president about the Iran-Contras affair.

However, Reagan said he would not respond to any queries on the subect until after a presidential review board headed by former Sen. John Tower, R- Texas, completes its investigation and issues a final report on Feb. 26.

Specifically, Reagan was asked whether he had given advance approval for the 1985 shipment of arms to Iran by Isrqel.

Reagan's former national security adviser, Robert McFarlane, has testified under oath that Reagan did approve the delivery in advance. However, White House chief of staff Donald Regan and Attorney General Edwin Meese have said Reagan did not know about the shipment until after the fact.

''I'm not going to take any questions on that situation until the Tower commission's report is turned in to us '' Reagan said. Asked if he would respond to questions once the report is delivered, he replied, ''It's possible.''

Reagan's most recent news conference was on Nov. 19. Not since Dec. 4 have reporters been allowed to attend brief photo sessions and ask questions.