I didn't have to do it on this phone since all my contacts are already on my Gmail account, but it usually works like this:
1. Go to your contacts app
2. Go to settings and import/export
3. Export your current contacts to your sd card or internal memory (I am assuming they transferred your contacts to the phone already and you just want to put them into Google)
4. Import from SD card or internal memory (depending where you exported them to) and choose Gmail when asked where to import them to.
That should do it. To avoid double entries you can either tell the phone to just display the contacts in your Google account, or you can go through your list and delete the contacts on your phone. Actually, come to think of it, before you import them to your Google account, you can just delete all the ones from the phone since they have been exported elsewhere. Once that is done import them and pick Google.
Disclaimer: If you loose all your contacts, it's not my fault.
Good luck.