Pattern formation and glassy phase in the phi(4) theory with a screened electrostatic repulsion