Nigel Farage resigns to trigger by-election in which he will stand