Toward a nonequilibrium thermodynamics of two-phase materials