Iran worked on developing nuclear weapons in the past, the UN's nuclear watchdog says, but such efforts did not go beyond the planning stages.