Set the Household field on the task, or create the task from the contact's Tasks tab. For deals, create the task from the opportunity — see How do I attach tasks to an opportunity?