This work presents a soft robotic module that can sense and control contact forces. The module is composed of a foam spring encapsulated by a pneumatic bellow that can be inflated to increase its stiffness. Optical sensors and a light source are integrated inside the soft pneumatic module. Changes in shape of the module lead to a variation in light reflectivity, which is captured by the optical sensors. These shape measurements are combined with air pressure measurements to predict the contact force through a machine learning model. Using these predictions, a closed-loop control of the contact force was implemented. The modules can be applied to realize pressure distribution control in support devices such as seats and mattresses. The presented method is robust and low-cost, can measure both shape and contact force, and does not require (rigid) sensors to be present at the movable contact interface between the support device and the user.