Israel and Egypt revealed yesterday that, aided by the intervention of President Carter, they have agreed tentatively on the main points of a peace treaty to end their hostility, which has fueled tensions in the Middle East for 30 years.

In announcing the breakthrough, George Sherman, spokesman for the U.S.-mediated talks here, cautioned that some issues still require resolution and that the agreement must be approved by both governments.

But, Sherman said, the delegations negotiating here since Oct. 12 have broken the impasse on the two biggest problems in the talks - linkage of the treaty to the future status of the Israeli-occupied West Bank and Gaza Strip and the pace of establishing diplomatic relations between the two countries.

Sherman also made clear that the breakthrough resulted from the intensive intervention launched by Carter Friday night after the talks appeared to have run into a deadlock.

At that time, Israeli Foreign Minister Moshe Dayan, who had been issuing gloomy warnings about unresolved difficulties, put the negotiations under a cloud of uncertainty by announcing that he and Defense Minister Ezer Weizman were returning to Jerusalem for consultations.

Faced with a flood of speculation that the talks were in danger of collapse, Carter responded by summoning the Israeli and Egyptian delegations to separate meetings at the White House on Friday night and Saturday morning.

The discussions there triggered a new, 4 1/2-hour negotiating session on Saturday, and, Sherman said yesterday, it was in that meeting that "the principal issues were resolved as far as the Egyptian and Israeli delegations are concerned."

The texts of the agreement have been referred to the Israeli and Egyptian governments; and, if they give their approval some sources connected to the talks said the treaty could be ready for initialing shortly after Dayan and Weizman return to Washington around the middle of this week.

Egyptian sources indicated last night that the draft treaty would be acceptable to President Anwar Sadat's government. On the other side, Dayan, before leaving Washington, said he would recommend that the Israeli cabinet approve the tentative agreement.

But, on his arrival in Israel yesterday, he sounded a slightly more cautious note, saying that, while "most of the problems" have been disposed of, important problems remain; and he stressed that the treaty is "not yet ready for signature."

Final conclusion of an Egyptian-Israeli peace treaty would give an incalculable boost to Carter's drive for a comprehensive settlement of the tensions that have made the Middle East a danger to world stability since the creation of Israel in 1948.

Formidable problems still stand in the way of reconciling other Arab states to an acceptance of Israel's existence and solving the thorny issue of a homeland for the Palestinians displaced from their homes in Israel.

But, since Egypt is the largest and militarily strngest country of the Arab world, a peace treaty would means, in effect, that there can be no more wars like those that have engulfed the region four times in three decades.

Without Egypt, the other Arab states are not stong enough to take Israel on in shooting war; and that is bound to become a factor of major importance in the effort to convince the other Arab countries that their disputes with Israel must be settled through peaceful negotiation.

Although Sherman would give no details of precisely what the treaty says, he revealed that the agreement covered the preamble and the various articles comprising the actual treaty.These deal with the principles and nature of peace between the two countries.

The still-unresolved issues, he said, involve points contained in three annexes that are to spell out the specifics of implementing the principles set down in the treaty. He said some of the annex language has been agreed upon and is being referred to the two governments for approval, but more negotiation is required on other points.

Sherman would not identify the issues still in contention. However, they are known to include the questions of compensating Israel for the costs of withdrawing from the Sinai peninsula and of future Israeli access to oil pumped from Sinai fields.

Neither issue is regarded as especially difficult to resolve. The reason they are still on the table is believed to be because they were not given priority attention in the 10 days of negotiation to date.

Oil experts from Egypt and Israel arrived in Washington yesterday and are expected to begin tackling the Sinai oil question intensively today. At issue is whether Israel, which had made a heavy investment in the Sinai fields and which derives about 15 percent of its crude oil needs from them, will have preferential supply and pricing access to them after they revert to Egyptian control.

On the financing question, Israel wants U.S. aid to help cover the costs of relocating settlers it had moved into the Sinai and of building two air bases to replace those it now has in the Sinai. However, as sources involved in the talks pointed out yesterday, that's really a matter that Israel has to negotiate with the United States rather than with Egypt.

Until yesterday's announcement, by far the biggest sticking point had stemmed from Egypt's insistence that the treaty should make some kind of reference to the future status of the West Bank and Gaza Strip.

These two areas, occupied by Israel since 1967, are outside the scope of the Egyptian-Israeli peace treaty. But Sadat has been seeking a linkage to guard himself against charges that, in settling his bilateral problems with Israel, he is abandoning the interests of the Palestinian refugees inhabiting these two areas.

Israel has contended that, in accordance with the decision last month at the Camp David summit to treat these areas separately, their future should be decided in another forum after the peace talks with Egypt are concluded.

In his announcement yesterday, Sherman, who was speaking on behalf of all three delegations in the talks, said unequivocally that the issue of West Bank-Gaza Strip linkage to the peace treaty had been "resolved satidfactorily so far as the delegations are concerned."

But Washington Post correspondent William Claiborne reported from Jerusalem that Dayan, on his arrival there, used much more guarded and fuzzy language in discussing the linkage question.

At an airport news conference, Claiborne reported, Dayan said the Egyptian-Israeli pact legally "stands on its won feet and is not conditional on other agreements." He added, though, that both countries are committed by the Camp David accords to continue beyond the current agreement to settle the West Bank-Gaza issue.

Despite the announcement in Washington, Claiborne said, Dayan's words were interpreted by some in Israel as a reserving of the Israeli position and an indication that the linkage question remains unresolved. But Claiborne added, others thought his caution was dictated primarily by domestic political considerations.

Israeli sources said Dayan and Weizman face a hard selling job when they present the agreement to Prime Minister Menachem Begin's cabinet. Some hard-line cabinet members have been taking a no-compromise stand on the linkage issue; and, Claiborne reported, Dayan's cautious language yesterday may have been aimed at avoiding too much public disscusion before he begins briefing the cabinet on the treaty tonight.

The other big issue that had been impeding progress in the talks involved Israel's insistence on full diplomatic relations with Egypt after Israel begins withdrawing its forces from the Sinai. Egypt, concerned about adverse reaction from other Arab countries that still consider themselves at war with Israel, had wanted to move more slowly.

Reliable sources said this problem has been resolved largely in Israel's favor, with a commitment by both sides to exchange diplomatic representatives at the level of ambassador rather than some lesser rank. However, the sources were unable to specify the agreed-on timetable for the opening of diplomatic relations.

Also reportedly resolved in Israel's favor was a dispute over an Egyptian proposal that the treaty be reopened for further negotiation after five years. Instead, the sources said, the Israelis agreed to procedures that will permit the treaty to be amended in the future by mutual consent.

The other issues known to have been largely agreed upon involve the technical details of Israel's withdrawal from the Sinai. The outlines of how that is supposed to be done were made public at the end of the Camp David meeting.

Following signing of the treaty, Israeli forces are supposed to pull back to a point midway between Israel's 1967 border and the Suez Canal. Israel is to complete the withdrawal from the Sinai within three years, with Egypt resuming full sovereignty over the territory occupied by Israel in the 1967 war.

During the interim period, Israeli and Egyptian forces in the Sinai are to be separated by a demilitarized zone in which only lightly armed U.N. personnel and police will be allowed.