How to transfer All of my iPhone contacts to my Mac?

I tried to do it through iCloud and it only transferred last names A-H.

Normally they are synced into the Contacts app that Macs come with. Check there. If you are syncing contacts using another service, eg. Gmail, go to your Contacts in there & make a file that could be imported into that app.