Its a big loss for anyone to lose their valuable contacts. However there are many applications available on playstore to recover from that kind of loss.
Restore Accidentally deleted contacts from an Android phone
One of them is very famous Restore Contacts :
One thing to note here is that it will not work on phone format as it will erase all memory slots. It will work well on your scenario. It works very well when you have accidentally deleted your contacts or intentionally. You can get them back easily, on single tap.
Below are the screenshots of this app, its just awesome :