Boundary contact energies for a variational model in phase separation