Quantum homotopy algebras are a generalization of homotopy algebras (such as, e.g., L-, A-,infinity algebras) with a scalar product and with operations corresponding to higher genus graphs. We construct a minimal model of a given quantum homotopy algebra via the homological perturbation lemma and show that it's given by a Feynman diagram expansion, computing the effective action in the finite-dimensional (noncommutative) Batalin-Vilkovisky formalism. We also construct a homotopy between the original and this effective quantum homotopy algebra.