Nonsmooth sparsity constrained optimization problems: optimality conditions