Keep in mind that someone has to maintain the infrastructure. Unless all food (or nutrient goop) production, all hardware production, mining, healthcare and such is automated, there will be people in the real world, walking either in biological or mechanical bodies (telepresence).
Even if machines took care of us, I don't believe that the desire to have children will ever completely disappear. I'm sure there would be ways to have and raise children for those who want it, even if it became ever more troublesome compared to the virtual life.
And then there are the virtual families you mentioned... If an AI actor can't be distinguished from a real human, even after decades of living together, I'd say the AI is alive. It could, maybe, eventually, mean that biological "humans" would get more and more rare, and depending on what your definition of "human" is, might go extinct, but something close enough (IMO) would continue to live in the digital world.
Real world cities might become ghost towns, but I believe some places would still be popular tourist attractions. Maybe not for the experience itself, but for having visited a place IRL.
In any case, this wouldn't be happening any time soon. In the wealthiest countries it might start in the next 50 years (very optimistic estimate), but it will take at least centuries more before all of humanity spends the majority of their time in virtual worlds. Even after that I don't think an "extinction" would happen in multiple millennia.