Brazil justice minister resigns to run for office