An optimal design problem for submerged bodies