On a more broad point, I tend to think humans are totally self-interested by nature and evolution, but I also think that we can at least push them towards acting with rational self-interest. By that, I mean get them to realize that sometimes a small sacrifice for the greater good of society is actually in their own self interest because they will live in a better society. For example, you want to pay taxes for good public education, a good social safety net, etc. because that will make the world around you better with less crime and more educated and less desperate people.
In this instance, you want to give your name and phone number because it stops the virus from spreading again which could either lead to you and/or your family getting the virus, or you being unable to get the food, medical, and other resources necessary for you to live.