Mesoscopic modeling of a two-phase flow in the presence of boundaries: The contact angle