If you are going to be flashing new custom ROMs or want to be free from worrying about your contacts, simply use a GMail account for all your contacts.
When you sign into GMail, your contacts are automatically backed and and also restored from GMail contacts list.
Even if you don’t use GMail, I highly suggest you make a dummy account just for your contacts.
I own around 20 Android smartphones and whenever I get a new phone, I just sign into my GMail and instantly my contacts are instantly restor