As hinted by the comments I replaced the query_posts by a WP_Query query.
$args=array(
'post_type' => 'restaurante',
'posts_per_page' => -1,
'meta_key' => 'restaurante_municipio',
'orderby' => 'meta_value',
'order' => 'ASC');
$the_query = null;
$the_query = new WP_Query($args);
if ( $the_query->have_posts() ) {
$total_results = $the_query->found_posts;
echo '<p><b>Restaurantes: '.$total_results.'</b>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
...
..
.
}
}
wp_reset_postdata();
Now it is working