GO:0004418:   hydroxymethylbilane synthase activity
Catalysis of the reaction: H(2)O + 4 porphobilinogen = hydroxymethylbilane + 4 NH(4)(+).