I am using a Sony Xperia Play with Android 2.3.3, but this should hopefully work on other Android phones too.
- I went into my contacts list on the phone and pressed my phone's menu button.
- I chose "Send contacts"
- It then let me select the contacts I wanted to send (I selected "all" but you could select specific ones via checkboxes if you like)
- I then pressed "Send" and sent them to my gmail address.
- When I opened the email in my gmail account on my computer, it gave me the option to "Import to Contacts".
- Click on that and you're done!
You may have some (or a lot) of duplicates on your phone now, so it may take a bit of manual work to delete the "phone" contacts now that you have Google ones.
- Or what I did, was go into my contacts list and click the "view contacts" button (on my phone it looks like a little group of people)
- From there, I clicked on "Phone Contact" and unchecked the checkbox.
So now, although I have duplicates, the phone is only displaying the "Google Contacts"
I hope this helps!