President Reagan said yesterday that his talks with Jordan's King Hussein have left him optimistic that broadened Middle East peace talks are "within our reach," and U.S. officials later added that they expect Hussein to decide soon whether he will join negotiations on a settlement of the Arab-Israeli conflict.

These developments came as Hussein and Reagan met for the second time in three days to discuss the president's Sept. 1 call for Jordan to enter talks on the future status of Israeli-occupied territories as the representative of their Palestinian inhabitants.

In contrast to the almost wary tone that characterized their public statements after Tuesday's meeting, the two leaders yesterday spoke in terms that, while not specific, contained a strong suggestion that the president is making progress in coaxing Hussein toward the bargaining table.

Despite yesterday's noticeably more upbeat atmosphere, it was not immediately clear whether the intensive U.S.-Jordanian talks here had succeeded in overcoming Hussein's hesitancy and doubts about the U.S. proposals or whether the administration was merely trying to counter charges that the Reagan initiative has become irretrievably bogged down.

U.S. officials were especially chary of talking about what Reagan might do to alleviate Hussein's concern about Israel's continued establishment of Jewish settlements in the West Bank.

The officials said the president agreed with Hussein that the settlements are "not helpful to the peace process," and one acknowledged that "it would be very difficult to imagine that the negotiations can be conducted while the expansion of settlements continues."

But these officials declined to say whether Reagan publicly will renew his call for a settlements freeze or will put some other pressure on Israel before an expected meeting here with Prime Minister Menachem Begin early next year.

Reagan took leave of the king by saying: "I think we've made significant progress toward peace. We have initiated a dialogue from which we should not consider turning back.

"Much work remains to be done, and the road ahead is tough. But it's the right road, and I remain optimistic that direct negotiations for a just resolution of the Palestinian problem in the context of a real and enduring peace is within our reach."

Hussein, who on Tuesday made only a perfunctory, noncommittal statement, replied: "We will go back to our area. We will be in close contact . . . with our brethren there. There is much that we will take back with us."

Then, in words that U.S. officials later said could mean another visit here by Hussein in the near future, the king added: "And we hope to be in touch again. I hope to have the privilege of being with you, sir, before too long."

A similarly optimistic note was sounded by a senior administration official who briefed reporters after Hussein's departure.

The official, who cannot be identified under the briefing rules, said that, from the U.S. standpoint, the meetings had been "successful and productive" in assuring Hussein that Reagan shares his sense of urgency about the need for action and intends to keep pursuing his initiative despite Israel's rejection of the plan.

Asked to elaborate on Hussein's remarks, the official said that within the next two or three weeks the king will consult with the Palestine Liberation Organization and other Arab governments about his talks here and, within a short time after these consultations, be back in touch with Washington.

"That's the next step," the official said. Asked if the United States expects Hussein to make a final decision about joining the peace talks after these consultations, the official replied: "I think that's a fair statement."

He stressed that Hussein had come principally to get a firsthand idea of how committed Reagan is to the Mideast initiative. The official added:

"It's always been quite clear this was not meant to be a definitive, final make-or-break session . . . . It was never intended that he'd walk out of the room and say, 'Here I am. It's all done. Where's the train?' "

Expanding on Hussein's remark that he had much to take back to the Middle East, the official said: "In broad terms, he is taking back the president's clear expression of his determination to adhere to the positions in his initiative . . . and a reiteration of the president's commitment to the principle of resolving the Arab-Israeli conflict on the basis of an exchange of territory as called for by U.N. Security Council Resolution 242."

The president's initiative put the United States on record as favoring the eventual independence of the West Bank and Gaza Strip "in association with Jordan." That idea is opposed by the Begin government, which has made clear that it wants to incorporate these territories into Israel.

Nicholas Veliotes, assistant secretary of state for Mideast affairs, went to New York yesterday to brief Israeli Foreign Minister Yitzhak Shamir -- who had stopped off there en route home from a South America visit -- on the talks with Hussein. Sources said Veliotes gave Shamir essentially the same information revealed by the senior official here, and had given no sign of any major new U.S. move on the settlements issue.