who wrote the song if i were a boy