You can try something like this:
<a href="<?php echo $this->url(
array(
'controller' => 'contact',
'action' => 'viewDetails',
'id' => $entry->id
),
'default',
true) ?>">
// Output: "contact/viewDetails/id/id_value" with id_value = $entry->id
And in viewDetails
action, you can retrieve the id like this:
$id = $this->getRequest()->getParam('id');
I hope it will help you :)