Artificial intelligence poses a similar risk of human extinction as pandemics and nuclear war, experts have warned.