You've got to ask yourself this question. If she didn't get pregnant would she have told you? How long has it been going on?
Difficult as you have a daughter, but I beleive that staying with someone for the kids sake is wrong because it is for the wrong reasons. You may have to leave the household and your daughters side for a brief time, but that will make you stronger as a person. You need to sort your head foremost, because who know's what you would do. You can then sort custody out at a later date. As tempting as it is to take your daughter, I think that would be a bad move. How old is she? Is she dependant on her mum?
You just have to be strong, as hard as it is...