North Korea agreed last month during six-nation talks in Beijing to abandon its nuclear weapons program in return for economic aid , energy assistance and security assurances .