A variational approach to the contact angle dynamics of spreading droplets