Joe Biden beats Donald Trump to win US election