Revised Answer:
Heres what I would do if I were you
Trigger
trigger TestTaskTrigger on Task (after insert) {
if(trigger.isInsert && trigger.isAfter){
Task_Methods.setWhat(trigger.new);
}
}
Class
public class Task_Methods{
public static void setWhat(List<Task> newList){
List<Task> tList = new List<Task>();
for(Task t : [SELECT Id, Who.AccountId FROM Task WHERE Id IN :newList AND WhoId != null AND Who.type = 'Contact']){
t.WhatId = t.who.AccountId;
tList.add(t);
}
if(tList.size() > 0){
update tList;
}
}
}