Afghanistan has quietly passed a law permitting Shia men to deny their wives food and sustenance if they refuse to obey their husbands' sexual demands, despite international outrage over an earlier version of the legislation which President Hamid Karzai had promised to review.

The new final draft of the legislation also grants guardianship of children exclusively to their fathers and grandfathers, and requires women to get permission from their husbands to work.

"It also effectively allows a rapist to avoid prosecution by paying 'blood money' to a girl who was injured when he raped her," the US charity Human Rights Watch said.

In early April, Barack Obama and Gordon Brown joined an international chorus of condemnation when the Guardian revealed that the earlier version of the law legalised rape within marriage, according to the UN.

Although Karzai appeared to back down, activists say the revised version of the law still contains repressive measures and contradicts the Afghan constitution and international treaties signed by the country.

Islamic law experts and human rights activists say that although the language of the original law has been changed, many of the provisions that alarmed women's rights groups remain, including this one: "Tamkeen is the readiness of the wife to submit to her husband's reasonable sexual enjoyment, and her prohibition from going out of the house, except in extreme circumstances, without her husband's permission. If any of the above provisions are not followed by the wife she is considered disobedient."

The law has been backed by the hardline Shia cleric Ayatollah Mohseni, who is thought to have influence over the voting intentions of some of the country's Shias, which make up around 20% of the population. Karzai has assiduously courted such minority leaders in the run up to next Thursday's election, which is likely to be a close run thing, according to a poll released yesterday.

Human Rights Watch, which has obtained a copy of the final law, called on all candidates to pledge to repeal the law, which it says contradicts Afghanistan's own constitution.

The group said that Karzai had "made an unthinkable deal to sell Afghan women out in the support of fundamentalists in the August 20 election".

Brad Adams, the organisation's Asia director, said: "The rights of Afghan women are being ripped up by powerful men who are using women as pawns in manoeuvres to gain power.

"These kinds of barbaric laws were supposed to have been relegated to the past with the overthrow of the Taliban in 2001, yet Karzai has revived them and given them his official stamp of approval."

The latest opinion poll by US democracy group the International Republican Institute showed that although Karzai was up 13 points to 44% since the last survey in May, his closest rival, Abdullah Abdullah, had soared from 7% to 26%.

If those numbers prove accurate, it would mean the contest would have to go to a second round run-off vote in early October. In that scenario, 50% of voters said they would vote for Karzai and 29% for Abdullah.

The survey was conducted in mid to late July, so it is not known whether Abdullah has made further gains on Karzai.

He could further increase his chance of victory by joining forces with Ashraf Ghani, the former finance minister who is also running on a platform fiercely critical of Karzai.

Fifty-eight per cent of the 2,400 people polled by IRI said they would like to see an alliance between Abdullah and Ghani, who is polling in fourth place.