Custom query does not find pages

This is not the place to use query_posts. query_posts should only be used if you need to change the main loop. There is also no need to reset the query and your missing endif on both loops.

I would use get_pages instead of running a new WP_Query.

$pages = get_pages();
foreach ( $pages as $page ) { ?>

<li class="ui-tabs-nav-item" id="nav-fragment-2"><a href="#fragment-2"><span><?php echo $page->post_title; ?></span></a></li> 

    <?php }