The former leadership candidate will quit as an MP to stand as an independent in next year's contest.