The party leader’s move follows the loss of several councils and a parliamentary by-election.