New variable-metric algorithms for nondifferentiable optimization problems