UK opposition leadership contest ends