If you are wanting to set up your phone as a new phone, yes, your contacts will be erased. However, you should have your contacts synced to a supported application on your computer, such as Address book or Outlook, or one of the web based services. If you have that, all you will have to do is sync the phone and the contacts will be back, just like music from your iTunes library.
Does that answer your question?