Solvability and optimization for a class of mixed variational problems