Yukio Hatoyama formally elected Japanese prime minister