Effects of strong magnetic fields in dense stellar matter