The contacts that are displayed in the Contacts app are actually a collection of contacts from one or more sources that can be stored on your iPhone as well as in online accounts such as iCloud, Gmail, Microsoft, Yahoo, etc. When some of your contacts disappear, it is caused by either having toggled off the use of Contacts from a given account, or that the entire account is unavailable on the iPhone.
You can see the sources of contacts on your iPhone in: Settings > Apps > Contacts > Contacts Accounts
That dialog shows you which accounts that are configured on your iPhone. Tap on one of those accounts and you can see if "Contacts" are enabled for that particular account. If you know which of your accounts contained the contacts that have disappeared, first make sure that Contacts are enabled on that page. If they are but the contacts are still gone, then go to the Mail app and try to send and receive a test email to yourself. Doing so is a way to test that your login is valid for the service and that you have a network connection available. If prompted for your password at that point, then entering it may reestablish a connection to the service and allow your contacts to appear again.