Interaction of hydrogen with defects in metals