Obama was elected to the U.S. Senate in November 2004 , representing the U.S. state of Illinois .