UK prime minister sees off party challengers but his standing has been dented