Phase field theory of surface- and size-induced microstructures