Sorry for the response to this old thread, but the answer above is misleading. We’re seeing quite a few posts lately from folks who get blank pages, because the loop posts were consumed by a call to query_posts() before the call to the main loop is made. The above will work perfectly well if your sidebar is called after the post content is displayed, but will show blank pages if it’s called before the Loop.
So, let’s just highlight this important note:
Important note
The query_posts function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page. If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead. Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.
The query_posts function overrides and replaces the main query for the page. To save your sanity, do not use it for any other purpose.
What you need is something like what was mentioned here:
Recent
<ul class="recent-posts">
<?php
$archive_query = new WP_Query('showposts=5');
while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>