UK premier to quit following Brexit vote