A complement to David's very good answer. A necessary condition for a curve $C$ over $\mathbb Q$ to be modular in your sense is as follows: (RM): each simple abelian variety $A$ that appear at a quotient of the Jacobian of $C$ is such that $End(A) \otimes \mathbb Q$ contains a totally real field of degree dim $A$ over $\mathbb Q$. Note that the condition on $A$ depends only on the isogeny class of $A$, so by Poincaré's theorem (RM) does not change if we replace the word "quotient" by "sub-abelian variety{. Note also that, to paraphrase David's argument, a generic abelian variety, and even a generic Jacobian should have $End(A)=\mathbb Z$, so should not satisfy the relevant condition if the genus is greater than one.