After the baby has grown into a toddler, look at his/her relationships and whichever guy has the famliy icon in his picture is the father.
Also, when a sim gets pregnant you will hear a music box sounding thing. If you can remember whichever guy was with her when you heard the music then thats the father.