In this letter we compute the exact effective superpotential of {cal N}=1 U(N) supersymmetric gauge theories with N_f fundamental flavors and an arbitrary tree-level polynomial superpotential for the adjoint Higgs field. We use the matrix model approach in the maximally confinig phase. When restricted to the case of a tree-level even polynomial superpotential, our computation reproduces the known result of the SU(N) theory.