BAGHDAD, July 23 (Reuters) - Iraq's parliament, which had been due to elect the country's president on Wednesday, postponed the vote by a day, delaying the formation of a power-sharing government urgently needed to confront a Sunni Muslim insurgency.

The advance by Sunni Islamist militants who seized swathes of northern Iraq last month has put the OPEC oil producer's survival in jeopardy. Its politicians have been deadlocked over forming a new government since an election in April.

Islamic State, an al Qaeda offshoot that is leading the insurgency, claimed responsibility for an overnight suicide bombing in a Shi'ite district of Baghdad that killed 33 people, one of the deadliest recent attacks in the capital.

The bloodshed highlighted the need for Iraq's politicians to form a united front against the militants, who want to march on the capital. Washington has made clear that it wants to see a more inclusive government established in Baghdad for the United States to provide military support against the insurgency.

Under Iraq's governing system, in place since the post-Saddam Hussein constitution was adopted in 2005, the prime minister is a member of the Shi'ite majority, the speaker a Sunni and the largely ceremonial president a Kurd.

Speaker Salim al-Jubouri told parliament that the Kurds had asked for a one-day delay on the vote so they could agree on a candidate. Parliament has until the end of the month to choose a president, who will then have 15 days to nominate a prime minister.

"Iraq cannot afford a protracted government formation process as the current threats continue to challenge the existence of the Iraqi state," Nickolay Mladenov, the U.N. special envoy to Iraq, told the U.N. Security Council on Wednesday.

A statement from parliament said U.N. Secretary-General Ban Ki-moon, who has been on a Middle East tour to seek an end to the fighting in Gaza, was expected to visit Baghdad on Thursday to meet Jubouri.

He is also expected to hold talks with Shi'ite Prime Minister Nuri al-Maliki.

PRESSURE BUILDS ON MALIKI

Maliki has ruled since the election, in a caretaker capacity, defying demands from the Sunnis and Kurds that he step aside for a less-polarising figure. Even some Shi'ite politicians want Maliki to go.

Islamic State, which shortened its name from the Islamic State in Iraq and the Levant after last month's advance, has declared its leader "caliph" - ruler of all Muslims.

It now controls a swathe of territory from Aleppo in Syria close to the Mediterranean to the outskirts of Baghdad.

Washington hopes a more inclusive government in Baghdad could save Iraq by persuading moderate Sunnis to turn against the insurgency, as many did during the "surge" offensive in 2006-7 when U.S. troops paid them to switch sides.

Iraq's army and allied Shi'ite militia have managed to halt the advance of Sunni fighters north of Baghdad but have struggled to recapture territory.

Government forces launched a counter-offensive a week ago to recapture Tikrit, home city of executed former president Saddam Hussein, but withdrew within hours after coming under fierce attack from the militants.

Although seizing Baghdad would be far more difficult for Islamic State than its gains in the north, the group has claimed responsibility for a wave of bombings in the capital.

A bomb planted in a restaurant in the mainly Shi'ite town of Mahmudiya just south of Baghdad killed two people on Wednesday, police and medical sources said.

Security forces found the bodies of eight Iraqi soldiers 3 km (2 miles) outside Samarra, the most northern city under full government control.

In the town of Jalawla, 115 km (70 miles) northeast of Baghdad, Islamic State gunmen killed six men because they were relatives of policemen, police said.

On Wednesday morning an air strike by government forces on a civilian neighbourhood in the town of Sharqat, north of Tikrit, killed 12 people, a hospital source said. (Additional reporting by Michelle Nichols at the United Nations; Writing by Michael Georgy; Editing by Robin Pomeroy and Alison Williams)