Reconstruction in the inverse crack problem by variational methods