Conservatives lose ruling majority in snap UK election