It says this in the Summer 13 release notes:
"When your organization has Communities enabled, User Sharing lets you control which other users Community members can see. You can control community members’ access to both internal and external users."
But it sounds like there might be an option without communities:
User Sharing for internal users is also available through a pilot program. For more information on enabling User Sharing for internal users, contact salesforce.com.
You can do it for example with a validation rule (read about them in your help&training). We try to push into asking a good question that shows some research effort and discourage "plz send me teh codez / do the homework for me").
A validation rule on Task object with error formula similar to
should do the trick?