All algebras of a certain type are said to form a Nielsen-Schreier variety if every subalgebra of every free algebra is free. Using methods of the operad theory, we propose an effective combinatorial criterion for that property in the case of algebras over a field of zero characteristic. Using this criterion, we show that the variety of all pre-Lie algebras is Nielsen-Schreier, and that, quite surprisingly, there are already infinitely many Nielsen-Schreier varieties of algebras with one binary operation and identities of degree three.