You can do it 2 ways.
1)
a - Easier way is sync your contacts with icloud on your phone (settings app, icloud, turn on contacts, do a icloud backup).
b - Than go onto your mac and open up CONTACTS app (can search for contacts in spotlight or just look in your apps folder)
c - go to preferences in the CONTACTS app, than ACCOUNTS and add your same icloud id. ALL your contacts will sync
2) open up itunes with your phone connected
a - make sure contacts is checked under info tab
b - merge contacts if requested.
i would try method 1 first as it is very easy