Rory Stewart, a one-time contender to become British prime minister, said on Friday he had resigned from the governing Conservative Party and would not run at the next election.