Israeli Prime Minister Menachem Begin, whose majority in the parliment has been steadily shrinking, today discussed with his Cabinet the possibility of calling for early elections, which could be held as soon as next May or June.

Begin's office denied a report on Israeli radio that Begin had firmly decided to submit a resolution to dissolve the parliment and had informed the ministers of his plan.

Spokesman Dan Pattir said Begin told the Cabinet that "whatever decisions or whatever proposals are brought forth," the earliest elections could be held is May or June.

"This is not an indication of operational thinking, and it is also not a denial that this kind of discussion" came up, Pattir said.

Begin's majority has slipped to 62 in the 120-member Knesset, two short of potentially losing a vote of confidence. He has persistently maintained in the past that he intends to serve out his full term, which ends in October 1981.

The Knesset is in summer recess and is not scheduled to return until Oct. 14. If Begin initiates a move to dissolve the parliment and ask for early elections, it would take at least six months to launch a campaign and set up the apparatus for balloting, his strategists said.

The question was said to have come up for serious discussion Monday when Begin, who was at home recuperating from a mild heart attack, was visited by Deputy Premier Simcha Ehrlich. Ehrlich reportedly told Begin that his rightist Likud bloc should seize the initative from the opposition Labor Party and force early elections, thereby also avoiding a humiliating parliamentary defeat that would put the party on the defensive at the outset of a campaign.

Begin is said to have agreed, and told Ehrlich he would call a meeting of the Likud leadership for Monday.

Sources said the matter came up almost accidentally at today's Cabinet meeting when Energy Minister Yitzhak Modai slipped Begin a note warning of a 25 percent increase in electricty prices. The prime minister is said to have announced suddenly that Likud could not stand big price rises before a campaign, thus leading to the discussion of the early elections.

Sources also said Begin discussed the matter privately with Interior Minister Yosef Burg, who also supported the idea of dissolving the parliment.

The National Religious Party, of which Burg is titular head, has become increasingly nervous as the pivotal partner in the Likud coalition because of the possibility that if Begin continues to plummet in popularity until the end of his full term, the Labor Party could win an absolute majority and form a government without coalition partners.

Since the founding of Isreal in 1948, the Religious Party has joined in coalition governments and has developed extensive patronage in the ministries of religious affairs, interior and education. Members of the party head those ministries now. The party, which has 12 Knesset members plans to discuss early elections in a leadership meeting Wednesday.

With the defections of all but three o the original 15 Democratic Movement members of the Knesset, many Religious Party members have concluded they should not be the last off a sinking ship and should start jockeying for position in a possible coalition with the Labor Party.

Labor tonight seized on the talk of early elections. Party leader Shimon Peres said "As of today, Israel has a lame-duck government," and suggested that elections could be held as soon as in 45 days.