In a highly contentious election marked by unexpected developments, voters have elected Donald Trump back to the White House after a four-year absence.