Genes of the baby are 100% determined by the fertilized egg. The genes will be from whoever donated the egg. This is usually the mother in practice, but since you need to do In-Vitro Fertilization anyways, there's no fundamental reason it couldn't be someone who is genetically unrelated to either the mom or womb-donor.
Note that genetics are not 100% in control, and the conditions of the pregnancy affect the outcome of the pregnancy. We don't know the full effects of this, and we certainly don't know which aspects of it are from the womb specifically vs other biological aspects of the mother (e.g. blood chemistry). Health of the mother certainly has correlations with birth weight and developmental progress, but the extent & mechanisms are still pretty opaque.
Edit: usually. As for nuclear DNA, keep in mind all of the weird crossover failures that are rather common in a large population. These typically result in gene dosing problems and can lead to fetus inviability.
Then consider the epigenome, selected immune recognition, and microbiome. These can be/are environmental.
50/50 is the textbook story we teach before undergrad. It's easier to learn and still conveys the central idea of the model.