Phase transitions and topological defects in the early universe