As Keerthi writes in his comment above, this follows from T. Saito's results. The statement in one direction, that non-trivial $GL_2(\mathbb Z_p)$-invariants implies that the associated $p$-adic Galois rep'n is crystalline at $p$, is in fact easier, and goes back to Scholl, and in principle goes back further than that. The point is that modular curves, and the universal elliptic curves over them, have good reduction at $p$ when $p$ doesn't divide the level, and the Galois representations appearing in the $p$-adic etale cohomology of a good reduction variety are crystalline. (As Arno Kret observes, there are technical issues related to the non-compactness of modular curves, but these were essentially resolved by Deligne already in his Bourbaki seminar on the construction of Galois rep's for modular forms, and were treated carefully by Scholl in his paper on motives attached to modular forms.)
The statement in the other direction is more difficult, because one has to show that ramified-at-$p$ modular forms give rise to Galois representations which are non-crystalline; Saito proves this (in fact he proves a much more precise local-global compatibility result).
These results all extend to the Hilbert modular case. In most cases, the Galois representations can be constructed directly from $p$-adic etale cohomology, and then the same geometric arguments apply (on Shimura curves now, rather than modular curves). (I think that Saito has a paper specificallly dealing with this.) In those situations for which the Galois representations are not constructed geometrically, but instead by a $p$-adic limiting process, one can still deduce these kinds of local-global compatibility-at-$p$ arguments in various ways. There is an eigenvariety argument due to Chenevier, which is written up in a paper of his, and in a joint paper of his and Harris. I think there are also arguments by Kisin, by Skinner, and by T. Liu. (I hope that commmenters will clarify or correct this list if it is incomplete or otherwise in error.)
One caveat: without chasing references, I'm not sure whether one can show that the monodromy operator is non-trivial in these limiting cases when it should be (the monodromy operator is hard to keep track of in arguments via $p$-adic families), so it may be that in these cases, when $\pi_v$ is Steinberg for a prime $v$ above $p$, one doesn't know whether the Galois representation is semi-stable but non-crystalline (as it should be) rather than crystalline.
(Perhaps someone can comment on this.)
Also, Ana Caraiani has introduced a geometric method which pins down the monodromy operator in these limiting cases (and with $GL_2$ replaced by $GL_n$). Her results at the moment only cover primes $v$ not dividing $p$, but it seems likely that she will be able to extend them to the case of $v$ dividing $p$.
In general, to see the state of the art on such local-global compatibility results at primes dividing $p$ (for $GL_n$, not just $GL_2$), you should look at the recent preprints on this topic by Barnet-Lamb--Gee--Geraghty--Taylor, available on Taylor's web-site. The general statement is given by Theorem A of the second preprint. (The assumption about Shin regular weight appearing in that result is what would be removed by the generalization of Caraiani's work to the case $v$ divides $p$ mentioned above.)