A quasi-potential for conservation laws with boundary conditions