If you installed WordPress using http://YOUR.IP.ADDRESS rather than http://YOUR.DOMAIN, WordPress may have incorrect settings for what it believes to be your site's true domain. As a result, it keeps redirecting you to the IP address. You can correct this through WordPress's General Settings, as shown below.