Voters in Uttar Pradesh take part in elections for the state assembly over the next three weeks. Photograph: Saurabh Das/AP

You can find the Islamic Centre of India in the Aishbagh neighbourhood of the north-eastern city of Lucknow, flanked by a Hindu temple and a wedding hall. Most evenings the call to prayer competes – or coexists – with the thumping bass of Bollywood dance tunes that accompany the nuptial celebrations of the city's middle classes. Often it is the centre itself that is the source of music, although the couples that hire its lawns for their wedding parties choose classical melodies that Muslim musicians have played in the city for centuries.

Lucknow, the capital of the state of Uttar Pradesh, has long been an important centre of south Asian Islamic culture. These days the music in the city – whether from films or mystic masters of Sufism – is being drowned out by the discordant tunes blaring from the tinny speakers on the campaign vehicles of political parties.

It is election time in the northern state of more than 200 million people, India's most populous, which if independent would be the world's fifth largest country.

Polling for the legislative assembly begins this week, and will last for three weeks because the state is so vast. Though politics in Uttar Pradesh rarely attracts much attention outside India, last month the battle for votes here hit global headlines.

A key constituency are the state's many Muslims, who account for about 18% of the population. This group could eventually swing some power in the state back to Congress, the party of the Gandhi dynasty, after a gap of more than 20 years. Congress will not win outright, but even a small improvement from its low level of support would be a victory. Critics claim that the Congress-led national government in Delhi was pursuing this Muslim vote when it very publicly failed to intervene to support Salman Rushdie, after ultra-conservative Islamic groups called for him to be stopped from speaking at a recent literary festival in India. According to the organisers of the event, this was a "defeat for free speech" and thus a "tragedy".

Rushdie, born in India, spoke of his disappointment at finding the country no longer committed to secularism and liberty, but a place where "religious extremists can prevent free expression of ideas at a literary festival [and where] the politicians are too … in bed with those groups to wish to oppose them for narrow electoral reasons".

For a few days, the dispute continued. Muslim groups said it was right that the author of The Satanic Verses, the 1988 book considered insulting to the prophet Muhammad, was prevented from talking. Liberals castigated the government for putting votes in Uttar Pradesh before principles. Few bothered to talk to Muslims in the state. For Khalid Rasheed, the cleric and scholar who directs the Islamic Centre in Aishbagh, the Muslim groups that had called for Rushdie to be denied entry to India were speaking for the community. "All Muslims are united. The words used by Salman Rushdie cannot be tolerated by any Muslims," Rasheed said.

Certainly, if Muslims in Lucknow and elsewhere are asked what they think of Rushdie the answer is uniform. "If anyone writes that against any religion, it is not tolerable," said Misba Khan, 31, a social worker. "Of course he should not be allowed to come and talk. He is out to create hatred."

But push a little further and a slightly different picture emerges, particularly in terms of how the state's Muslims might vote and why. Uttar Pradesh has poverty levels worse than most of sub-Saharan Africa. More than half of the children are chronically malnourished and nearly half of women cannot read or write.

About 100 miles north of Lucknow, and 40 miles south of the Nepal border, is the scruffy town of Gonda. It lies in one of the poorest parts of Uttar Pradesh. The roads that exist are so pitted and holed that the short distance from the state capital takes more than three hours.

It is a desolate drive, even in winter, when temperatures are bearable. In summer, crows fall dead from the sky in temperatures of 45C or higher. Most villages are without power; almost none have proper sanitation; many comprise little more than a miserable huddle of mud and straw huts.

About half the population are either Dalits, the caste at the bottom of India's ancient but still tenacious social hierarchy, or Muslims who, repeated surveys have shown, are among the most disadvantaged people in India. Even in the towns, life is little better.

"The government says there is electricity 14 hours every day, but if we get two or three we are lucky," said Dinesh Shukla, a journalist in Gonda. "There are no jobs. There is nothing."

Five years ago, Dalit and Muslim votes carried the firebrand populist Mayawati Kumari to power in Uttar Pradesh. She is hoping that the support of the same communities will, despite the rampant corruption and broad lack of development during her reign, bring her another five-year term. A second caste-based party is her biggest challenger. The Congress party comes a weak third or even fourth behind the Hindu nationalist BJP.

Last week, as Mayawati addressed a rally in Gonda, only a hundred yards away Muslim barbers cut and shaved their customers without even lifting their heads when the chief minister's helicopter circled and landed.

"If Congress had helped Rushdie come, then we would have been angry. No Muslim likes him. But that doesn't mean we are going to vote for them. We will vote for people who make our lives better," said Kaleem. "No one listens to the poor people anyway."

Uttar Pradesh was long the fief of India's foremost political dynasty. Jawaharlal Nehru, the country's first prime minister, and his daughter Indira Gandhi, perhaps its most controversial leader, both held parliamentary seats in the state. Now it is the turn of Indira Gandhi's grandchildren, Rahul and Priyanka Gandhi, to campaign in the dusty lanes and villages of the dynastic seats near Lucknow. This adds a personal dimension to the fight for the Muslim vote in the state.

The old city of Lucknow is a labyrinth of alleys choked by cows, motorbikes, chickens and filth. Vast monuments dating from the time when the city was a centre of refined culture, wealth and power rear up above the jumble of rooftops and wires. Old houses with ornate plasterwork that are now home to scores of destitute families disintegrate slowly.

The glorious past of the city, from where the nawabs of Awadh once ruled before being deposed by the British, is evident everywhere.

At a religious school where hundreds of students learn Arabic, English and Persian, the language of the Mughal and Awadhi courts, Farooq Alvi, who runs a perfume business, spoke of how his family had been using the same techniques since "the time of Shah Jahan", the 17th-century emperor who built the Taj Mahal.

The glorious history is now long gone. In a cramped office, Zafaryab Jilani, a Muslim lawyer at the high court, said that little had changed in recent years despite India's economic growth. "Some of India is shining … but not all of India," he said.

Near by, underneath a vast poster advertising a satellite television channel devoted to discussions and recitals of accounts of the prophet's deeds, Mohammed Saeed, 69, served tea for four rupees a cup.

Illiterate and half-blind, Saeed had not heard of the Rushdie affair. He spoke instead of his ill wife and his children, all seven of whom had died of various illnesses, leaving their parents alone in their old age.

"The best time for Uttar Pradesh? That would be in the 1950s, when I was young, and food was cheap and there were less people and the air was good and the water didn't make you sick," he said.