Let \rho be a modulo p representation of the absolute Galois group of a
totally real number field. Under the assumptions that \rho has large image and
admits a low weight crystalline modular deformation we show that any low weight
crystalline deformation of \rho unramified outside a finite set of primes will
be modular. We follow the approach of Wiles as generalized by Fujiwara. The
main new ingredient is an Ihara type lemma for the local component at \rho of
the middle degree cohomology of a Hilbert modular variety. As an application we
relate the algebraic p-part of the value at 1 of the adjoint L-function
associated to a Hilbert modular newform to the cardinality of the corresponding
Selmer group.Comment: This is a completely revised version (30 pages