Hard to saw without looking at it, but an educated guess:
More than likely it is the CSS for the admin bar, which only appears when you are logged in. the <?php wp_head() ?>
will include the css for it, and <?php wp_footer(); ?>
includes the html for the admin bar.
If you look, it should actually be a margin-top added to the html tag.