There are technically two different methods for extracting iPhone contacts from a backup on Mac or Computer:
1. You can use a 3rd party tool which will enable you to scan and Extract iPhone Contacts from Backup File.
There are plenty of applications on the market that will help you do this, but the only one I can recommend is iStonesoft because it's the only one I've used so far.
2. You also can extract iPhone directly contacts from a backup file (and this only applies if you've already synced your iPhone with iTunes).
This is all about syncing your iPhone to itunes (if you do this regularly, you should already have a few backups stored for you to choose from).
I went into a bit more detail about this on another Q&A site, so rather than retyping it, why not check out my answer here: answers.oreilly.com/topic/13720-how-do-i-extract-iphone-cont