Ref. No. 2683/45-4142
In the name of Allah the most Gracious the most Merciful
The answer to your question is as follows:
If you wash the girl’s urine or stool and your hand is stained with the impurities of urine or stool, your hand became impure and it is necessary to wash the hands to get it pure. If the child’s impure body is dry and you hold it, you don’t need wash your hands just because you have touched the impure body. Hence if you prayer after that your prayer will be valid. If impure water splashes on your clothes or body while washing the girl's impure clothes or body, it is necessary to wash your clothes. So, you have to be very careful while washing your baby’s impurities.
And Allah knows best
Darul Ifta
Darul Uloom Waqf Deoband