Paul Nuttall has resigned as the leader of UKIP following his party's disastrous results in the election.