As you see in the reference, the first parameter for CDbCriteria::compare() is
CDbCriteria::compare()
Usually it is a name of a column in a table. You can not use a PHP method here.
But you can use a valid SQL expression instead of a column name here. So what you have to do is write some SQL expression that is equivalent to the PHP method "getLastContact()".