Gracias Darkj. Ya está solucionado. Pongo la solución por si a alguien le puede servir.
Código:
<A HREF="pagina_a_visitar.html" OnClick="parent.location='clickcounter.php?url=pagina_a_visitar.html'" target="_blank">
TITULO DE LA PAGINA
</A>
Código PHP:
<?
// get the URL from the variable
$urlupdate = $_GET['url'];
// updates the counter
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $bd);
$update = "UPDATE pages SET accesscounter = accesscounter + 1 WHERE url = '$urlupdate'";
$result = mysql_query($update);
//return to previous screen
echo '<script type=""text/javascript"">history.go(-1);</script>';
?>