hook civicrm_post not triggering as expected (Joomla)
OK, it was my stupid fault. The function isn't only called when a contact is created - it's called when any event happens (eg cron job). So the important line is the conditional statement (which should be the first line of the function) which decides whether the function should continue. In my case, this conditional line was:

IF ( ($objectName != 'Individual' &amp;&amp; $objectName != 'Organization') || $op != 'create') { return; }