<?php

// query
$users = UserQuery::create('u')
    ->withColumn('COUNT(*)', 'ProfileCount')
    ->joinWith('u.UserProfile p')
    /* your query */
    ->groupBy('u.Id')
->find();

// in your PHP code
$users[0]->getProfileCount(); // see "withColumn" above, second argument.

// note
// prefer to make a COUNT(column_name) rather than a COUNT(*), better perfs.