Barack Obama has said the US must and will take action against Russia over hacking during the presidential election.