Catalysis of the reaction: S-adenosyl-L-methionine + histone H3 L-lysine (position 27) = S-adenosyl-L-homocysteine + histone H3 N6-methyl-L-lysine (position 27). This reaction is the addition of a methyl group to the lysine residue at position 27 of the histone H3 protein.