British prime minister agrees to resign, outlets say