The ratification by the Guardian Council means that the bill, overwhelmingly approved by parliament last month, now needs only a presidential signature. It was not clear when that would take place.
The law will strengthen the government's hand in resisting international pressure permanently to abandon uranium enrichment, a process that can produce fuel for nuclear reactors or material for atomic bombs.
Iran has been under pressure to curb its nuclear programme, which the United States claims is part of an effort to produce weapons. Iran says its programme is aimed at generating electricity.
While Iran has frozen its enrichment programme, it restarted uranium conversion - a step toward enrichment - in August.
The International Atomic Energy Agency has warned Iran that its nuclear programme could be referred to the UN Security Council, which has the power to impose sanctions on the country.
The IAEA said: "If Iran's nuclear file is referred or reported to the UN Security Council, the government will be required to cancel all voluntary measures it has taken and implement all scientific, research and executive programmes to enable the rights of the nation under the Nuclear Non-proliferation Treaty."
Iran restarted uranium
reconversion in August
Cancelling voluntary measures means that Iran would stop allowing in-depth IAEA inspections of its nuclear facilities and would resume uranium enrichment.
Iran has been allowing short-notice inspections of those facilities under a signed, but not ratified, protocol to the Nuclear Non-proliferation Treaty.
The US and European Union want Iran to halt uranium enrichment permanently. But Tehran says the NPT allows it to pursue a nuclear programme for peaceful purposes, and says it will never give up the right to enrich uranium to produce nuclear fuel.
In May, the Guardian Council ratified a bill compelling the government to continue the nuclear programme, including uranium enrichment activities. The law set no timetable, however, allowing the government room to manoeuvre during negotiations with Europe.
Talks between Britain, France, Germany and Iran broke off in August after Tehran restarted uranium conversion.
Manouchehr Mottaki, Iran's foreign minister, said on Wednesday that talks would resume within two weeks.