A husband hit his wife twice on the head with a heavy metal bar then told police he may have killed her, York Crown Court heard.