A senior State Department official secretly visited Jordan's King Hussein several days before President Reagan made public his Middle East peace plan and was given Hussein's assurance that he will consider the plan seriously, U.S. officials said yesterday.

The officials, who asked not to be identified, said the trip by Nicholas Veliotes, assistant secretary for Mideast affairs, was the major reason for Secretary of State George P. Shultz' cautious optimism in discussing the possibility of Hussein joining the peace process. Shultz said Thursday that, while Hussein had made no commitments, he was "seriously" studying the Reagan proposal.

A central element of the plan outlined by Reagan on Wednesday was a call for resolving the Palestinian problem by eventually granting self-rule to the Israeli-occupied West Bank and Gaza Strip "in association with Jordan" instead of permitting these territories to become an independent Palestinian state.

Hussein so far has refused to join the U.S.-sponsored negotiations on autonomy for the occupied territories and is still officially committed to the position that only the Palestine Liberation Organization can speak for the 1.3 million Palestinians in these areas.

The officials said Veliotes visited Jordan, apparently during the 10 days preceding Reagan's speech, and participated with U.S. Ambassador Richard N. Viets in discussing the plan with Hussein. The king reportedly gave the idea a sympathetic hearing but said he wanted to sound out the opinion of other Arab leaders before making any commitments.

According to the officials, Hussein is expected to begin these explorations during the Arab summit meeting next week in the Moroccan city of Fez. However, the officials added, it probably will take some time, perhaps weeks, before he is ready to give a definitive response to Reagan's proposals.

The revelations about Veliotes' talks with Hussein came as the State Department denied Israeli charges that the United States violated its commitments to Prime Minister Menachem Begin's government by not informing Israel of the plan before Reagan announced it. Details of the proposal, in its final form, were given to the leaders of Israel, Egypt, Jordan and Saudi Arabia on Tuesday.

"The United States has not violated any of its commitments to Israel," department spokesman John Hughes said in reference to agreements calling for Washington to consult Israel on any significant events in the Middle East.

"On the question of consultation," Hughes said, "the president's initiative came after three years of autonomy negotiations, three recent trips to the Middle East by Secretary of State Alexander M. Haig and Ambassador Richard Fairbanks, and numerous bilateral talks between the U.S. and each of the parties involved."

The spokesman added: "Second, the views presented by the president are positions which have long been part of the public record or which have been discussed with Israel over the course of the three-year autonomy negotiations. Finally, the president did not call for immediate acceptance of these views, but negotiations about it."

He said Israel and the Arab countries involved were consulted equally, and he added: "The plan was not run by the Arab countries first."

The administration also stuck to its contention that the communique issued Thursday by the Israeli Cabinet, rejecting the American plan and refusing to negotiate on it, does not constitute an official response to Reagan's proposal.

Hughes characterized the Israeli communique as an "informal, early" response, and, while he expressed optimism that the plan eventually will spark movement toward Mideast peace, he acknowledged that the effort "will require time and careful diplomacy."

U.S. officials also continued to reject the contention of the Israeli government that Reagan's plan is contrary to the Camp David accords because it allegedly calls for a predetermined outcome of matters that are supposed to be resolved through negotiation.

They reiterated that Reagan's proposals are subject to negotiation, and they noted that both of the other Camp David signatories, Israel and Egypt, have put forward their own views about the eventual status of the occupied territories.

The administration's position has been backed by former president Carter, the mediator and architect of the 1978 Camp David agreement. He said on Thursday, "There is absolutely nothing in the president's speech, nor in the information he sent to the Israelis, which is contrary to the letter or the spirit of the Camp David agreements. This is absolutely compatible with the Camp David agreements."

In Santa Barbara, Calif., White House deputy press secretary Larry Speakes reiterated the administration's pleasure at the response given Reagan's speech. Speakes cited Carter's support and several favorable editorials and said that "the generally positive response to the president's initiative is heartening to the United States."