Yes, on both.
Time Machine (TM) automatically backs up your entire user folder, and that includes the data used by the Contacts app.
As an example, here’s how you would restore a deleted contact from TM:
- Open the Contacts app.
- With the app open and active, enter TM by clicking on the TM icon in the menu bar > Enter Time Machine.
- You’ll should now see the TM interface layered with previous states of your Contacts app.
- Use the timeline on the right to navigate to a backup before the contact was deleted.
- Once you see the contact listed, select it, and click Restore.