Iran has said it could end a ban on possessing nuclear weapons amid threats of sanctions from the UN.