Lost all my contacts after flashing custom rom (sg2)
Via your desktop computer, go to the Contacts section in Gmail. Click the MORE button and then RESTORE CONTACTS.

You'll be shown a dialog box where you can pick a particular time to restore to within the past 30 days.

That should restore your contact data.

After that just sync your device.