Functional designed to include surface effects in self-consistent density functional theory