@user1632018 reports that the problem has been solved:
I removed both the
<ul>
and<li>
tags and now the navigation is in its
proper location:
<div class="header">
<div class="nav">
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>