  We prove that for $d \in \{ 2,3,5,7,13 \}$ and $K$ a quadratic (or rational)
field of discriminant $D$ and Dirichlet character $\chi$, if a prime $p$ is
large enough compared to $D$, there is a newform $f \in S_2(\Gamma_0(dp^2))$
with sign $(+1)$ with respect to the Atkin-Lehner involution $w_{p^2}$ such
that $L(f \otimes \chi,1) \neq 0$. This result is obtained through an estimate
of a weighted sum of twists of $L$-functions which generalises a result of
Ellenberg. It relies on the approximate functional equation for the
$L$-functions $L(f \otimes \chi, \cdot)$ and a Petersson trace formula
restricted to Atkin-Lehner eigenspaces. An application of this nonvanishing
theorem will be given in terms of existence of rank zero quotients of some
twisted jacobians, which generalises a result of Darmon and Merel.
