Self-Gravitating Stringlike Configurations from Nonlinear Electrodynamics