Sudden loss of contacts on my Samsung Galaxy S - running Gingerbread
I don't know why it happened, but a good way to prevent it from happening again is to set your contacts to sync with your Google account. This way whenever you add a new contact, it will be uploaded, and if the phone loses your contacts again, you probably won't even notice it, as they will be automatically downloaded back to your phone.