Es posible que tengas otro onload que sobreescriba el que estás mostrando (quizá un body onload), porque así sí funciona:
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<script type="text/javascript">
onload = focusIt;
function focusIt()
{
document.frmContacta.txtNombre.focus();
}
</script>
</head>
<body>
<form name="frmContacta" action="contacta.php" method="POST">
<label>Nombre: </label><input type="text" name="txtNombre" value="" size="30">
<label>Correo electrónico: </label><input type="text" name="txtCorreo" value="" size="30"><br><br>
<label>Asunto: </label><input type="text" name="txtAsunto" value="" size="50"/><br><br>
<label>Mensaje: </label><textarea name="txtMensaje" rows="4" cols="45">
</textarea><br>
<input type="submit" class="boton" value="Enviar" name="cmdEnviar"/>
</form>
</body>
</html>