Israelis go to the polls to elect a new government tomorrow in what is becoming a cliffhanger contest between the rightwing opposition leader, Benjamin Netanyahu, and his rival Tzipi Livni, the centrist foreign minister.

Netanyahu, leader of the Likud party, is slightly ahead, and given the combined size of the rightwing parties that would support him he is thought most likely to lead the next coalition government. But up to a fifth of voters are thought to be undecided, according to opinion polls.

Israel's proportional representation voting system is complicated and no single party will be able to form a government without bringing four or five other parties into a coalition. Even if Livni's Kadima party emerges with the largest number of seats most analysts think she would struggle to put together a like-minded coalition with enough seats to have a majority in the Knesset, or parliament.

"It will be very, very difficult for Livni to form a government, even if Kadima turns out to be the bigger party, because every government of Livni would depend on a rightwing party," said Yossi Verter, a political commentator for the left-leaning Ha'aretz newspaper.

After the final results of the election are formally published in a week's time Israeli president Shimon Peres will consult with the leaders of all parties and will choose one MP to form a coalition.

That decision will probably be made on Friday next week and whoever is chosen would then have 42 days to form the coalition. In the past the president has always turned to the leader of the largest party, though the law does allow him to turn to others if they are more likely to form a ­majority coalition.

That means if Netanyahu comes in second but the rightwing parties do as well as the polls suggest, Peres might still call on him to form the coalition. "Since Likud has such a big bloc, it is not impossible that Peres will give the mandate to Netanyahu even if Likud is smaller than Kadima," Verter said.

The high level of undecided voters hours before polling begins is unusual in Israel and suggests a broader frustration with many of the country's political leaders. Both Netanyahu and Ehud Barak, head of the Labour party, have been prime minister in the past and were generally regarded as unpopular. Livni has been criticised for lacking experience.

"Just a few weeks ago everyone was happily bathing in the pool of national consensus created by the operation in Gaza," Nahum Barnea, a leading columnist, wrote in today's Yedioth Ahronoth newspaper. "How strong we are, everyone said, how united we are. Now it becomes apparent that underneath this joyful power hides a frightened people, wishing for someone strong and forceful, who will ­miraculously fend off the people's enemies, real and ­imaginary."

Barnea argued that the election campaign showed only that Israel's political establishment "no longer meets the needs of the country and society". He wrote: "The larger they are on the billboards, the more they are dwarfed by the country's problems."

Only a few weeks ago Netanyahu had a commanding lead in the opinion polls, a lead apparently reinforced by Israel's devastating war in Gaza. However, in the final days of the campaign he has begun to lose support to Avigdor Lieberman, a far-right secular politician whose populist tone has captured the public mood like never before. Netanyahu has made a point of not attacking Lieberman in his campaign.

The last polls, released on Friday, gave Netanyahu between 25 and 27 seats in the 120-seat Knesset, ahead of Livni's Kadima party on 23 to 25 seats.

It is widely presumed that if Netanyahu wins he will turn to Lieberman to join his coalition, offering a major cabinet position. Some reports have suggested Lieberman wants to be defence minister, regarded as perhaps the most high-profile job after prime minister, although his elevation to such a key post is by no means certain.

"He is an enigma in Israeli politics," Verter said of Lieberman. "You can never foresee his actions or his next move." While Lieberman is loud and aggressive in campaigning and in opposition, Verter said in the past he had remained quiet when in government.

Livni has pointedly not ruled out an alliance with Lieberman herself and was reportedly ready to offer two incentives – a law on civil marriage and a reform of the election system – both of which Lieberman has demanded. However, any deal with him would probably cost her the support of some of the smaller leftwing parties likely to join her bloc, including the Arab parties and Meretz, leaving her still reliant on at least one other rightwing party to form a majority coalition

Livni spent today on a train journey from Tel Aviv to Be'er Sheva, in Israel's south and has delivered a determinedly centrist pitch. "We have proved that security does not belong only to the right and peace does not belong only to the left," she said at a rally in Tel Aviv yesterday.

Netanyahu has taken a more rightwing position, travelling up to the Golan Heights yesterday with his party's most hawkish figures to plant a tree and to insist he would never give up that piece of territory – captured by Israel in 1967 from Syria. "The Golan will remain ours only if Likud is elected," he said.

Meanwhile in Gaza, fighting continued. A Palestinian militant from the Islamic ­Jihad was killed early this morning in a clash with Israeli troops. Israeli aircraft hit two targets overnight in what the military said was retaliation for rocket fire into southern Israel.