The countries which developed nuclear weapons and nuclear energy technologies agreed to license nuclear energy technologies to countries that didn't have it. The terms require non-proliferation and disarmament:
The International Court of Justice (ICJ), in its advisory opinion on the Legality of the Threat or Use of Nuclear Weapons, issued 8 July 1996, unanimously interprets the text of Article VI as implying that
"There exists an obligation to pursue in good faith and bring to a conclusion negotiations leading to nuclear disarmament in all its aspects under strict and effective international control."
The ICJ opinion notes that this obligation involves all NPT parties (not just the nuclear weapon states) and does not suggest a specific time frame for nuclear disarmament.[14]
http://en.wikipedia.org/wiki/Treaty_on_the_Non-Proliferation_of_Nuclear_Weapons
The five NPT nuclear weapon states are also the five permamanent members of the UN Security Council. They have been been negotiating arms reduction and verification treaties, and have greatly reduced their stockpiles over the decades. Obama was unanimously awarded the Nobel Peace Prize to encourage him in this effort, and he's made a lot of progress. His Science Advisor John Holdren is an expert in this area - one of the reasons Obama chose him.
India, Pakistan, and Israel don't belong to the NPT, so it doesn't directly apply to them. However, members are prohibited from providing non-members with anything that can be used to make nuclear weapons , so it indirectly applies to them. That's why Bush's "Nukes-for-Mangoes" was such a bad idea - it gave India a waiver. India reached "peak uranium" and was facing the choice of ending their nuclear weapons program or ending their nuclear energy program. Bush's "nukes-for-mangoes" waiver enabled them to do both. I think Australia still refuses to sell uranium to India, not sure if they've caved or not.