US President Joe Biden has announced that he will end his candidacy for re-election, saying "it is in the best interest of my party and the country".