We prove that every matrix-valued rational function F , which is regular on the closure of a bounded domain D P in C d and which has the associated Agler norm strictly less than 1, admits a finite-dimensional contractive realizationHere D P is defined by the inequality P(z) < 1, where P(z) is a direct sum of matrix polynomials P i (z) (so that appropriate Archimedean and approximation conditions are satisfied), and P(z) n = k i=1 P i (z) ⊗ I ni , with some k-tuple n of multiplicities n i ; special cases include the open unit polydisk and the classical Cartan domains. The proof uses a matrix-valued version of a Hermitian Positivstellensatz by Putinar, and a lurking contraction argument. As a consequence, we show that every polynomial with no zeros on the closure of D P is a factor of det(I − KP(z) n ), with a contractive matrix K.