Secretary of State Cyrus R. Vance will visit the Middle East next week in an attempt to break the deadlock between Egyptian and Israeli leaders over a peace treaty, the State Department said yesterday.

Vance's trip was announced less than 24 hours after a department spokesman denied categorically that there were any plans for the secretary to undertake a Middle East mission.

The sudden shift appeared to represent a decision by the Carter administration that Egyptian President Anwar Sadat and Israeli Prime Minister Menachem Begin are unable to resolve the differences stalling their negotiations and that the United States, as mediator of the talks, has to step in with a high-level effort to close the gap.

George Sherman, a State Department officer acting as spokesman for the talks, said only that the trip was decided on Monday night after a review of the situation by Vance and President Carter.

"The president decided the time had come for the secretary to go to the area to talk with both leaders," Sherman said. "Up to Monday evening, the trip was not planned or contemplated."

He added that the main factors influencing their decision were their talks last weekend with Egyptian Prime Minister Mustafa Khalil, who was here to explain Egypt's thinking, and the private response made yesterday by Begin's cabinet to Sadat's most recent negotiating proposals.

Although details of the Isreaeli reply have been kept secret, they are understood to amount to a rejection of Egyptian demands on the two issues that have held up agreement on a peace treaty for almost a month.

One is Egypt's call for a timetable or target date for implementing autonomy for the Palestinian residents of the Israeli-occupied West Bank and Gaza Strip areas.

Under the Camp David accords, the West Bank issue is supposed to be negotiated separately from the Egyptian-Israeli peace treaty. But Sadat wants a linkage included in the treaty package to protect himself against charges in the Arab world that he is forsaking the interests of the Palestinians.

The second disputed issue involves Egypt's desire to change a clause in the draft treaty stating that the accord between Israel and Egypt takes precedence over other Egyptian alliances, including those with other Arab countries.

In their reply to Sadat yesterday, the Israelis reportedly signified their willingness to keep negotiating. But, according to reliable sources, they also renewed their refusal to accept a Palestinian autonomy timetable or to permit changes in the draft text.

These are the main differences that Vance will be trying to reconcile in his separate meetings with Sadat and Begin. But, diplomatic sources said yesterday, while the problems are clear, there is still considerable confusion about what will be required to solve them.

In particular, the sources said, Vance will have to gauge whether the two sides are sticking to their positions out of deeply held principles or whether they are willing to be flexible if ways can be found to allow them to shift position gracefully.

In any event, the sources added, it is unlikely that the Vance trip will result either in completion of a treaty or a breakdown in the negotiations. Instead, they said, it should be viewed as one more move in the tortuous, step-by-step process of U.S. intervention that has been required to keep the seven-week-old negotiations moving.

Although precise details of Vance's itinerary were not announced yesterday, the department said he will leave Washington Friday evening, deliver a long-scheduled speech in London on Saturday, fly to Cairo on Monday and then go on to Jerusalem later in the week.

In order to prepare for the trip, the announcement said, Vance has canceled plans to attend the winter meeting of NATO foreign ministers in Brussels later this week. Deputy Secretary Warren M. Christopher will represent him.